A few minor changes to image handling