More flexible image handling