fix media controller clean up for image upload