Upgraded Magento from 1.8.0.1 to latest 1.9.3. and all seemed to be fine. The image uploader was broken but managed to fix that by reading the files for the older flash uploader. So basically can add images to products and it works. However, there is some problem with the cache and images on frontend is slowly disappearing. They are loaded from media/catalog/product/cache/etc... but the image is not there. Seems as the caching of images is broken or something. Found several threads on the subject but none with this particular issue. Any ideas how to solve it?
EDIT: Some new info. Also upgraded php on the server from 5.4 to 5.6 and it seems as magento is rebuilding cache fine but only for png images. My assumption is that php_gd is not set to work with jpg. How do activate that?