Tidies up PhotoCanvas code. WARNING: Only displays jpg images. Unable to display bmp and gif images.