refactored baseImageController