adding support for images, finally fixing db issues