Added a method to return png as file.
Added block manipulation for png tempfile.
Refactored a bit for clarity.
Removed useless naming.