implemented more sophisticated image library to allow for proper orientation amoved photo library code into module