bug fixes, working image fxn

overall very very hacky, but will work. excited to completely re-write
in python