fix warnings for browsers that don't support image previews

also some formatting