Generated spritesheets are always square

Fixed a logic bug that resulted in square spritesheet output in formats in which it is not necessary.