fixed bugs with photometry

fixed some problems with photometry so that
it now works with valid input, still have some
work to do on the front end