image sizing and cleanup