Add new functions for ImageController.php