initial implementation of image handling