Add logic to sortabel pic viewer

added logic for add.ctp and edit.ctp; Add of img fails when add form has
errors (todo: refactor form validation and handel it with ajax)