Fixed and finished the get_image_data method.