Rewrote/refactored makeimage
Use makeimage function directly