Fix for #86 - save image with proper resolution, remove format nesting and fixed code blocks