WIP: rempt/trim on saving
This patch adds an option to the file settings that, if enabled, will trim the image's layers as much as possible. It also makes trim to image size use this logic:
- a layer is trimmed to the intersection of the image bounds and the layer exact bounds (not the layer bounds), so all empty tiles at the borders of the layer are not saved