Refactoring, fixes

Refactored the styling of a bunch of php code, fixed image source on
edit item page