Corrected method to check max image size