updated code for images