Code clean-up related to images