fixed bug with making images from database
fixed bug with creating images from database
fixed merge conflicts