check for image format and size quicker