improved image/bitmap handling