Fix 404 error on protected attachments