cleaned up the images controller