Implement generate method to create image