moved switch_upload_image_type to appropriate file