multiple refactorings; Using getData instead of getTile to retrieve image data
(cherry-picked from edc7921)