Division by zero in theme_image_style_preview after moving to production server
Apparently it is not safe to chmod files to 777.

A preferred way is to chmod files to 644, directories to 755 and set the ownership to the webserver, so the webserver can write files.

Here's a script for Ubuntu:

# Change directory permissions to 755.
find sites/default/files -type d -exec chmod 755 {} +
# Change folder permissions to 644.
find sites/default/files -type f -exec chmod 644 {} +
# Set ownership to webserver.
chown -R www-data:www-data sites/default/files


Learn more on - Recommended directory permissions.