Master Page Gallery add or remove file results in Access Denied

Today I was working on some customizations in SharePoint Online and I needed to add files to the Master Page Gallery. I could add folders, but when I tried to upload files I got an Access Denied message "Sorry, you don't have access to this page": Master Page Gallery Request Access First I [...]