updated for Paperclip 4.0