added function for handling specified image sizes