bugfix for non-raw images
Added support for TMS sources