Improved metadata generation for image files