Better handling of image resources