convert relative url to absolute for picture preview, add content-type checking for pictures