simplified code for formatting images for readability