fixed a bug and shaved off one ms from 4 MP image