Feature/export image metadata

This pull request implements export image with metadata array. The array currently only supports density in ppi. I also found and fixed an issue with export <format> which wasn't setting the image format. Probably nobody uses that because I couldn't find an open report.