Take padding into account in sprite maps

Only briefly tested in default mode, but seems to work so far.
Merge pull request #45 from JodiWarren/patch-1

Take padding into account in sprite maps