added ability to specify scale and resolution for generated images