Added the ability to specify flags to inputs. Useful for if you want the image to be grayscale.