Clean up code for checking image format