added null-picture protection, removed extraneous logging