Code fix and organization

Cleaned up code for readability. Fixed bug involving image upload while
filter is active.