Wrote module with function that generates the jpg image