Extracted image_for_url method to clearify functionality